package com.tfblog.blog.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tfblog.blog.entity.Blog;
import com.tfblog.blog.entity.Tag;
import com.tfblog.blog.vo.DayCount;
import com.tfblog.blog.vo.TimeVO;
import com.tfblog.utils.PageUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * <p>
 *  服务类
 * </p>
 *
 * @author tfeng
 * @since 2021-04-26
 */
public interface BlogService extends IService<Blog> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryPageByTypeId(Long typeId, Map<String, Object> params);

    PageUtils queryPageByTag(Long typeId, Map<String, Object> params);

    List<Blog> selectBlogsByTypeId(Long id);

    List<Blog> selectBlogsByTagId(Long id);

    void saveBlogIdAndTagIds(Long blogId, Long[] tagIds);

    Blog selectBlogById(Long blogId, Long tId, Long styleId);

    List<Tag> selectTagsByBlogId(Long id);

    void updateBlogIdAndTagIds(Long blogId, Long[] tagIds);

    void deleteBlog(Long id);

    PageUtils qureryPageDraft(Map<String, Object> params);

    PageUtils queryHotBlogs(Map<String, Object> params);

    Blog selectDetailsById(Long id);

    List<TimeVO> findTimeInfo(Long year, Long month);

    int findBlogCountByTypeId(Long id);

    int findBlogCountByTagId(Long id);

    List<DayCount> findEveryDayBlogCount(Long year);

    PageUtils queryNewBlogs();

    Long findMinYear();

    Blog findBlogById(Long blogId);
}
